package com.leader.say.dao;

import com.leader.say.entity.LeaderSay;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LeaderMapper {

    @Select("SELECT\n" +
            "ls.id,\n" +
            "ls.leader_say as leaderSay,\n" +
            "ls.create_time as createTime\n" +
            "FROM\n" +
            "leader_say AS ls\n")
    List<LeaderSay> selectAllSay();

    @Insert("INSERT INTO `leader_say` (`leader_say`, `create_time`) VALUES ( #{msg}, now());")
    int insertLeaderSay(String msg);

}
